package cn.xopencode.recordservice.provider.kvoperation;

import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.manager.kvoperation.KvOperationRecordManager;
import cn.xopencode.recordservice.rpc.kvoperation.KvOperationRecordRpc;
import cn.xopencode.recordservice.rpc.kvoperation.dto.*;
import cn.xopencode.recordservice.rpc.kvoperation.vo.*;
import cn.xopencode.recordservice.rpc.robotroom.dto.AdminRecordPageDTO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 10KV操作室巡检记录 Rpc 实现类
 */
@DubboService(version = "${dubbo.provider.KvOpertionRecordRpc.version}")
public class KvOpertionRecordRpcImpl implements KvOperationRecordRpc {

    @Autowired
    private KvOperationRecordManager kvOperationRecordManager;

    @Override
    public CommonResult<KvOperationRecordCreateVO> createKvOperationRecord(KvOperationRecordCreateDTO createDTO) {
        return CommonResult.success(kvOperationRecordManager.createKvOperationRecord(createDTO));
    }

    @Override
    public CommonResult<Integer> createKvOperationRecordNextLine(KvOperationRecordNextCreateDTO nextCreateDTO) {
        return CommonResult.success(kvOperationRecordManager.createKvOperationRecordNextLine(nextCreateDTO));
    }

    @Override
    public CommonResult<PageResult<KvOperationRecordPageVO>> pageKvOperationRecord(KvOperationRecordPageDTO pageDTO) {
        return CommonResult.success(kvOperationRecordManager.pageKvOperationRecord(pageDTO));
    }

    @Override
    public CommonResult<KvOperationRecordVO> getKvOperationRecordById(String id) {
        return CommonResult.success(kvOperationRecordManager.getKvOperationRecordById(id));
    }

    @Override
    public CommonResult<KvOperationRecordNextVO> getKvOperationRecordNextById(String recordCode, Integer recordSeq) {
        return CommonResult.success(kvOperationRecordManager.getKvOperationRecordNextById(recordCode,recordSeq));
    }


    @Override
    public CommonResult<Integer> updateKvOperationRecord(KvOperationRecordUpdateDTO updateDTO) {
        return CommonResult.success(kvOperationRecordManager.updateKvOperationRecord(updateDTO));
    }

    @Override
    public CommonResult<Integer> updateKvOperationRecordNext(KvOperationRecordNextUpdateDTO updateDTO) {
        return CommonResult.success(kvOperationRecordManager.updateKvOperationRecordNextLine(updateDTO));
    }

    @Override
    public CommonResult<Integer> dealKvOperationRecordLineException(String recordDetailId) {
        return CommonResult.success(kvOperationRecordManager.dealKvOperationRecordLineException(recordDetailId));
    }

    @Override
    public CommonResult<PageResult<KvOperationRecordAdminPageVO>> getAdminPage10KvOperationRecord(AdminRecordPageDTO pageDTO) {
        return CommonResult.success(kvOperationRecordManager.getAdminPage10KvOperationRecord(pageDTO));
    }
}
